﻿
using App.Components;
using FreeSql;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace App.DAL
{
    public class AppContext : DbContext
    { 
        public static IFreeSql IFreeSql { get; set; }
        public DbSet<SysUser> SysUsers { get; set; } 
        public AppContext(){ }

        protected override void OnConfiguring(DbContextOptionsBuilder builder)
        { 
            builder.UseFreeSql(IFreeSql);
        }








        public static DAL.AppContext Current
        {
            get
            {
                return Asp.GetContextData("__DbContext", () => new DAL.AppContext()) as DAL.AppContext;
            }
        }
    }


}
